using NUnit.Framework;

namespace Brianhdk.Utils.VisualStudio.AssemblyInfoDialog.Tests
{
    [TestFixture]
    public class AssemblyFilePathStrategyTester
    {
        [TestCase(@"c:\someproject.csPROJ")]
        [TestCase(@"c:\someproject.additional.csproj")]
        [TestCase(@"c:\someproject.vbproj")]
        [TestCase(@"c:\someproject.additional.vbproj")]
        [TestCase(@"c:\someproject.fsproj")]
        [TestCase(@"c:\someproject.additional.FSproj")]
        public void Create_InputFilePath_Returns_RetrieveAssemblyFilePathFromProjectFile(string filePath)
        {
            var actual = AssemblyFilePathStrategy.Create(filePath);

            Assert.That(actual, Is.InstanceOf(typeof (RetrieveAssemblyFilePathFromProjectFile)));
        }

        [TestCase(@"c:\someassembly.DLL")]
        [TestCase(@"c:\someassembly.additional.dll")]
        [TestCase(@"c:\somefile.exe")]
        [TestCase(@"c:\somefile.additional.EXE")]
        public void Create_InputFilePath_Returns_ReturnAssemblyFilePathDirectly(string filePath)
        {
            var actual = AssemblyFilePathStrategy.Create(filePath);

            Assert.That(actual, Is.InstanceOf(typeof(ReturnAssemblyFilePathDirectly)));
        }

        [TestCase(null)]
        [TestCase("")]
        [TestCase(@"c:\somefile.txt")]
        public void Create_InvalidInputFilePath_MissingAssemblyFilePathStrategyException(string invalidFilePath)
        {
            Assert.Throws<MissingAssemblyFilePathStrategyException>(() => 
                AssemblyFilePathStrategy.Create(invalidFilePath));
        }
    }
}